package st.yushao.restaurant.action.custom;

import st.yushao.restaurant.dao.FoodDaoService;
import st.yushao.restaurant.fw.AbstractBaseAction;
import st.yushao.restaurant.vo.FoodVO;

public class GetFoodInfo extends AbstractBaseAction {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -5682883008991171925L;

    /**
     * FoodDaoService
     */
    private FoodDaoService fds;

    /**
     * foodId
     */
    private int foodId;

    private FoodVO food;

    /**
     * getter of food
     */
    public FoodVO getFood() {
        return food;
    }

    public FoodDaoService getFds() {
        return fds;
    }

    public void setFds(FoodDaoService fds) {
        this.fds = fds;
    }

    public int getFoodId() {
        return foodId;
    }

    public void setFoodId(int foodId) {
        this.foodId = foodId;
    }

    /**
     * get the Food by the foodId from food table
     *
     * @return getFoodInfo by the foodId
     */
    public String doExecute() {
        // getFoodById
        food = fds.getFoodById(foodId);
        return SUCCESS;
    }
}
